/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Calendar;

/**
 * <p>Project: javase - Str3
 * <p>Powered by webrx On 2021-12-02 15:36:17
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Str3 {
    public static void main(String[] args) {
        String str = "Hello-中文-java程序设计";

        System.out.println(str.substring(6, 8));

        System.out.println(str);
        var str2 = "";
        for (int i = 0; i < str.length(); i++) {
            str2 = str.charAt(i) + str2;
        }
        System.out.println(str2);

        var c = Calendar.getInstance();
        var w = c.get(Calendar.DAY_OF_WEEK);
        System.out.println("星期" + "日一二三四五六".charAt(w - 1));

        String file = "c:/user/abc/upload/xxsfasf.afasf-asfas.jpg";
        //求出文件目录 c:/user/abc/upload/
        //求出文件名称 xxsfasf.afasf-asfas.jpg
        //求出文件的扩展名 jpg
        //将字符换为c:/user/abc/upload/20211202154333.jpg
        System.out.println("hello".replace("l", "123"));

        System.out.println("hello".indexOf("java"));
    }
}
